<template>
	<view class="content box-shadow">
		<view class="flex flex-column" style="padding: 40upx;">
			<view class="flex-1" style="text-align: center;">
				<image class="logo" src="/static/logo.png"></image>
			</view>
			<view class="flex-1" style="margin-top: 100upx;">
				<view class="flex flex-row" style="line-height: 70upx; height: 70upx;text-align: left;">
					<view style="width: 80upx;">
						<text style="font-size: 30upx;color: #333333;">账号:</text>
					</view>
					<view class="flex-1">
						<input class="input-border"  v-model="account" type="text"
						 placeholder="请输入账号" />
					</view>
					<view style="width: 50upx;text-align: center; height: 70upx;line-height: 70upx;" v-if="account.length>0" @tap="clearAccount">
						<image style="width: 30upx; height: 30upx;" src="../../static/close.png" mode="aspectFill"></image>
					</view>
				</view>
			</view>
			<view class="flex-1" style="margin-top: 20upx;">
				<view class="flex flex-row" style=" line-height: 70upx; height: 70upx;text-align: left;">
					<view style="width: 80upx;">
						<text style="font-size: 30upx;color: #333333;">密码:</text>
					</view>
					<view class="flex-1">
						<input class="input-border" @input="getAccount(password)" v-model="password"
						 type="password" placeholder="请输入密码" />
					</view>
					<view style="width: 50upx;text-align: center; height: 70upx;line-height: 70upx;" v-if="password.length>0" @tap="clearPassword">
						<image style="width: 30upx; height: 30upx;" src="../../static/close.png" mode="aspectFill"></image>
					</view>
				</view>
			</view>
			<view class="flex-1" style="margin-top: 40upx;">
				<view class="flex flex-row" style="justify-content: space-between;">
					<view style="font-size: 30upx;color: #999999;" @tap="goForgetPage">忘记密码</view>
					<view style="font-size: 30upx;color: #999999;" @tap="goRegisterPage">注册账号</view>
				</view>
			</view>
			<view style="flex:1;margin-top: 300upx;">
				<button type="primary" @tap="nextPage">登录</button>
			</view>
		</view>

	</view>
</template>

<script>
	export default {
		data() {
			return {
				account: '',
				password: ''
			}
		},
		onLoad() {

		},
		methods: {
			clearAccount() {
				this.account = ''
			},
			clearPassword() {
				this.password = ''
			},
			goRegisterPage(){
				uni.navigateTo({
					url:'../register/register'
				})
			},
			goForgetPage(){
				uni.navigateTo({
					url:'../forget/forget'
				})
			},
			nextPage(){
				uni.navigateTo({
					url:'../list/list'
				})
			}
		}
	}
</script>

<style>
	.content {
		border: 1upx solid #F8F8F8;
		margin: 140upx 30upx;
		background-color: #FFFFFF;
	}

	.logo {
		height: 180upx;
		width: 180upx;
	}
	.flex{
		display: flex;
	}
	.flex-1{
		flex: 1;
	}
	.flex-column{
		flex-direction: column;
	}
	.flex-row{
		flex-direction: row;
	}
	.box-shadow {
		box-shadow: 4upx 4upx 10upx rgba(0, 0, 0, 0.2);
	}
	.input-border {
		border: 1upx solid #999999;
		min-height: 60upx;
	}
</style>
